TEXTURE_METHOD_LOCAL,
TEXTURE_METHOD_GL,
TEXTURE_METHOD_GL_RELEASED,
+ TEXTURE_METHOD_PNG,
+ TEXTURE_METHOD_PNG_PIXBUF,
+ TEXTURE_METHOD_TIFF,
+ TEXTURE_METHOD_TIFF_PIXBUF,
N_TEXTURE_METHODS
} TextureMethod;
gdk_gl_texture_release (GDK_GL_TEXTURE (texture));
break;
+ case TEXTURE_METHOD_PNG:
+ {
+ GBytes *bytes = gdk_texture_save_to_png_bytes (texture);
+ g_assert (bytes);
+ g_object_unref (texture);
+ texture = gdk_texture_new_from_bytes (bytes, NULL);
+ g_assert (texture);
+ g_bytes_unref (bytes);
+ }
+ break;
+
+ case TEXTURE_METHOD_PNG_PIXBUF:
+ {
+ GInputStream *stream;
+ GdkPixbuf *pixbuf;
+ GBytes *bytes;
+
+ bytes = gdk_texture_save_to_png_bytes (texture);
+ g_assert (bytes);
+ g_object_unref (texture);
+ stream = g_memory_input_stream_new_from_bytes (bytes);
+ pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, NULL);
+ g_object_unref (stream);
+ g_assert (pixbuf);
+ texture = gdk_texture_new_for_pixbuf (pixbuf);
+ g_assert (texture);
+ g_object_unref (pixbuf);
+ g_bytes_unref (bytes);
+ }
+ break;
+
+ case TEXTURE_METHOD_TIFF:
+ {
+ GBytes *bytes = gdk_texture_save_to_tiff_bytes (texture);
+ g_assert (bytes);
+ g_object_unref (texture);
+ texture = gdk_texture_new_from_bytes (bytes, NULL);
+ g_assert (texture);
+ g_bytes_unref (bytes);
+ }
+ break;
+
+ case TEXTURE_METHOD_TIFF_PIXBUF:
+ {
+ GInputStream *stream;
+ GdkPixbuf *pixbuf;
+ GBytes *bytes;
+
+ bytes = gdk_texture_save_to_png_bytes (texture);
+ g_assert (bytes);
+ g_object_unref (texture);
+ stream = g_memory_input_stream_new_from_bytes (bytes);
+ pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, NULL);
+ g_object_unref (stream);
+ g_assert (pixbuf);
+ texture = gdk_texture_new_for_pixbuf (pixbuf);
+ g_assert (texture);
+ g_object_unref (pixbuf);
+ g_bytes_unref (bytes);
+ }
+ break;
+
case N_TEXTURE_METHODS:
default:
g_assert_not_reached ();
{
for (method = 0; method < N_TEXTURE_METHODS; method++)
{
- const char *method_names[N_TEXTURE_METHODS] = { "local", "gl", "gl-released" };
+ const char *method_names[N_TEXTURE_METHODS] = { "local", "gl", "gl-released", "png", "png-pixbuf", "tiff", "tiff-pixbuf" };
char *test_name = g_strdup_printf ("%s/%s/%s",
name,
g_enum_get_value (enum_class, format)->value_nick,